package com.example.miniappssm.service.serviceImpl;

import com.example.miniappssm.bean.Camera;
import com.example.miniappssm.mapper.CameraMapper;
import com.example.miniappssm.service.CameraService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CameraServiceImpl implements CameraService {

    @Autowired
    CameraMapper cameraMapper;

    @Override
    public Camera showCameraByCameraId(Integer cameraId) {
        return cameraMapper.selectCameraByCameraId(cameraId);
    }

    @Override
    public List<Camera> showAllCamera() {
        return cameraMapper.selectAllCamera();
    }

    @Override
    public void addCamera(Camera camera) {
        cameraMapper.insertCamera(camera);
    }

    @Override
    public void updateCamera(Camera camera) {
        cameraMapper.updateCamera(camera);
    }

    @Override
    public void removeCameraByCameraId(Integer cameraId) {
        cameraMapper.deleteCameraByCameraId(cameraId);
    }
}
